<?php

namespace App\Listeners\Prize;

use App\Events\PrizeBinded;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Morefun\Prize\RedisSynchronizer as PrizeRedisSynchronizer;

class WritePrizesToRedis
{
    protected $synchronizer;

    public function __construct(PrizeRedisSynchronizer $synchronizer)
    {
        $this->synchronizer = $synchronizer;
    }

    /**
     * Handle the event.
     *
     * @param  PrizeBinded  $event
     * @return void
     */
    public function handle(PrizeBinded $event)
    {
        $this->synchronizer->write($event->getActivityId());
    }
}
